Optimal. Leaf size=160 \[ \frac {a^2 \sin ^{1+n}(c+d x)}{d (1+n)}+\frac {2 a^2 \sin ^{2+n}(c+d x)}{d (2+n)}-\frac {a^2 \sin ^{3+n}(c+d x)}{d (3+n)}-\frac {4 a^2 \sin ^{4+n}(c+d x)}{d (4+n)}-\frac {a^2 \sin ^{5+n}(c+d x)}{d (5+n)}+\frac {2 a^2 \sin ^{6+n}(c+d x)}{d (6+n)}+\frac {a^2 \sin ^{7+n}(c+d x)}{d (7+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 160, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {2915, 90}
\begin {gather*} \frac {a^2 \sin ^{n+1}(c+d x)}{d (n+1)}+\frac {2 a^2 \sin ^{n+2}(c+d x)}{d (n+2)}-\frac {a^2 \sin ^{n+3}(c+d x)}{d (n+3)}-\frac {4 a^2 \sin ^{n+4}(c+d x)}{d (n+4)}-\frac {a^2 \sin ^{n+5}(c+d x)}{d (n+5)}+\frac {2 a^2 \sin ^{n+6}(c+d x)}{d (n+6)}+\frac {a^2 \sin ^{n+7}(c+d x)}{d (n+7)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 2915
Rubi steps
\begin {align*} \int \cos ^5(c+d x) \sin ^n(c+d x) (a+a \sin (c+d x))^2 \, dx &=\frac {\text {Subst}\left (\int (a-x)^2 \left (\frac {x}{a}\right )^n (a+x)^4 \, dx,x,a \sin (c+d x)\right )}{a^5 d}\\ &=\frac {\text {Subst}\left (\int \left (a^6 \left (\frac {x}{a}\right )^n+2 a^6 \left (\frac {x}{a}\right )^{1+n}-a^6 \left (\frac {x}{a}\right )^{2+n}-4 a^6 \left (\frac {x}{a}\right )^{3+n}-a^6 \left (\frac {x}{a}\right )^{4+n}+2 a^6 \left (\frac {x}{a}\right )^{5+n}+a^6 \left (\frac {x}{a}\right )^{6+n}\right ) \, dx,x,a \sin (c+d x)\right )}{a^5 d}\\ &=\frac {a^2 \sin ^{1+n}(c+d x)}{d (1+n)}+\frac {2 a^2 \sin ^{2+n}(c+d x)}{d (2+n)}-\frac {a^2 \sin ^{3+n}(c+d x)}{d (3+n)}-\frac {4 a^2 \sin ^{4+n}(c+d x)}{d (4+n)}-\frac {a^2 \sin ^{5+n}(c+d x)}{d (5+n)}+\frac {2 a^2 \sin ^{6+n}(c+d x)}{d (6+n)}+\frac {a^2 \sin ^{7+n}(c+d x)}{d (7+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.28, size = 110, normalized size = 0.69 \begin {gather*} \frac {a^2 \sin ^{1+n}(c+d x) \left (\frac {1}{1+n}+\frac {2 \sin (c+d x)}{2+n}-\frac {\sin ^2(c+d x)}{3+n}-\frac {4 \sin ^3(c+d x)}{4+n}-\frac {\sin ^4(c+d x)}{5+n}+\frac {2 \sin ^5(c+d x)}{6+n}+\frac {\sin ^6(c+d x)}{7+n}\right )}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.40, size = 0, normalized size = 0.00 \[\int \left (\cos ^{5}\left (d x +c \right )\right ) \left (\sin ^{n}\left (d x +c \right )\right ) \left (a +a \sin \left (d x +c \right )\right )^{2}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 143, normalized size = 0.89 \begin {gather*} \frac {\frac {a^{2} \sin \left (d x + c\right )^{n + 7}}{n + 7} + \frac {2 \, a^{2} \sin \left (d x + c\right )^{n + 6}}{n + 6} - \frac {a^{2} \sin \left (d x + c\right )^{n + 5}}{n + 5} - \frac {4 \, a^{2} \sin \left (d x + c\right )^{n + 4}}{n + 4} - \frac {a^{2} \sin \left (d x + c\right )^{n + 3}}{n + 3} + \frac {2 \, a^{2} \sin \left (d x + c\right )^{n + 2}}{n + 2} + \frac {a^{2} \sin \left (d x + c\right )^{n + 1}}{n + 1}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 473 vs.
\(2 (160) = 320\).
time = 0.43, size = 473, normalized size = 2.96 \begin {gather*} -\frac {{\left (2 \, {\left (a^{2} n^{6} + 22 \, a^{2} n^{5} + 190 \, a^{2} n^{4} + 820 \, a^{2} n^{3} + 1849 \, a^{2} n^{2} + 2038 \, a^{2} n + 840 \, a^{2}\right )} \cos \left (d x + c\right )^{6} - 16 \, a^{2} n^{4} - 256 \, a^{2} n^{3} - 2 \, {\left (a^{2} n^{6} + 18 \, a^{2} n^{5} + 118 \, a^{2} n^{4} + 348 \, a^{2} n^{3} + 457 \, a^{2} n^{2} + 210 \, a^{2} n\right )} \cos \left (d x + c\right )^{4} - 1376 \, a^{2} n^{2} - 2816 \, a^{2} n - 8 \, {\left (a^{2} n^{5} + 16 \, a^{2} n^{4} + 86 \, a^{2} n^{3} + 176 \, a^{2} n^{2} + 105 \, a^{2} n\right )} \cos \left (d x + c\right )^{2} - 1680 \, a^{2} + {\left ({\left (a^{2} n^{6} + 21 \, a^{2} n^{5} + 175 \, a^{2} n^{4} + 735 \, a^{2} n^{3} + 1624 \, a^{2} n^{2} + 1764 \, a^{2} n + 720 \, a^{2}\right )} \cos \left (d x + c\right )^{6} - 16 \, a^{2} n^{4} - 256 \, a^{2} n^{3} - 2 \, {\left (a^{2} n^{6} + 20 \, a^{2} n^{5} + 159 \, a^{2} n^{4} + 640 \, a^{2} n^{3} + 1364 \, a^{2} n^{2} + 1440 \, a^{2} n + 576 \, a^{2}\right )} \cos \left (d x + c\right )^{4} - 1472 \, a^{2} n^{2} - 3584 \, a^{2} n - 8 \, {\left (a^{2} n^{5} + 17 \, a^{2} n^{4} + 108 \, a^{2} n^{3} + 316 \, a^{2} n^{2} + 416 \, a^{2} n + 192 \, a^{2}\right )} \cos \left (d x + c\right )^{2} - 3072 \, a^{2}\right )} \sin \left (d x + c\right )\right )} \sin \left (d x + c\right )^{n}}{d n^{7} + 28 \, d n^{6} + 322 \, d n^{5} + 1960 \, d n^{4} + 6769 \, d n^{3} + 13132 \, d n^{2} + 13068 \, d n + 5040 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 14997 vs.
\(2 (134) = 268\).
time = 21.57, size = 14997, normalized size = 93.73 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 576 vs.
\(2 (160) = 320\).
time = 0.57, size = 576, normalized size = 3.60 \begin {gather*} \frac {\frac {{\left (n^{2} \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{7} + 8 \, n \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{7} - 2 \, n^{2} \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{5} + 15 \, \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{7} - 20 \, n \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{5} + n^{2} \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{3} - 42 \, \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{5} + 12 \, n \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{3} + 35 \, \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{3}\right )} a^{2}}{n^{3} + 15 \, n^{2} + 71 \, n + 105} + \frac {2 \, {\left (n^{2} \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{6} + 6 \, n \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{6} - 2 \, n^{2} \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{4} + 8 \, \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{6} - 16 \, n \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{4} + n^{2} \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{2} - 24 \, \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{4} + 10 \, n \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{2} + 24 \, \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{2}\right )} a^{2}}{n^{3} + 12 \, n^{2} + 44 \, n + 48} + \frac {{\left (n^{2} \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{5} + 4 \, n \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{5} - 2 \, n^{2} \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{3} + 3 \, \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{5} - 12 \, n \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{3} + n^{2} \sin \left (d x + c\right )^{n} \sin \left (d x + c\right ) - 10 \, \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )^{3} + 8 \, n \sin \left (d x + c\right )^{n} \sin \left (d x + c\right ) + 15 \, \sin \left (d x + c\right )^{n} \sin \left (d x + c\right )\right )} a^{2}}{n^{3} + 9 \, n^{2} + 23 \, n + 15}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 14.66, size = 819, normalized size = 5.12 \begin {gather*} \frac {a^2\,{\sin \left (c+d\,x\right )}^n\,\left (n^6\,1{}\mathrm {i}+n^5\,30{}\mathrm {i}+n^4\,398{}\mathrm {i}+n^3\,2788{}\mathrm {i}+n^2\,10137{}\mathrm {i}+n\,16958{}\mathrm {i}+9240{}\mathrm {i}\right )}{8\,d\,\left (n^7\,1{}\mathrm {i}+n^6\,28{}\mathrm {i}+n^5\,322{}\mathrm {i}+n^4\,1960{}\mathrm {i}+n^3\,6769{}\mathrm {i}+n^2\,13132{}\mathrm {i}+n\,13068{}\mathrm {i}+5040{}\mathrm {i}\right )}-\frac {a^2\,{\sin \left (c+d\,x\right )}^n\,\sin \left (7\,c+7\,d\,x\right )\,\left (n^6+21\,n^5+175\,n^4+735\,n^3+1624\,n^2+1764\,n+720\right )\,1{}\mathrm {i}}{64\,d\,\left (n^7\,1{}\mathrm {i}+n^6\,28{}\mathrm {i}+n^5\,322{}\mathrm {i}+n^4\,1960{}\mathrm {i}+n^3\,6769{}\mathrm {i}+n^2\,13132{}\mathrm {i}+n\,13068{}\mathrm {i}+5040{}\mathrm {i}\right )}+\frac {a^2\,\sin \left (c+d\,x\right )\,{\sin \left (c+d\,x\right )}^n\,\left (11\,n^6+343\,n^5+4869\,n^4+36773\,n^3+148360\,n^2+296844\,n+226800\right )\,1{}\mathrm {i}}{64\,d\,\left (n^7\,1{}\mathrm {i}+n^6\,28{}\mathrm {i}+n^5\,322{}\mathrm {i}+n^4\,1960{}\mathrm {i}+n^3\,6769{}\mathrm {i}+n^2\,13132{}\mathrm {i}+n\,13068{}\mathrm {i}+5040{}\mathrm {i}\right )}-\frac {a^2\,{\sin \left (c+d\,x\right )}^n\,\cos \left (6\,c+6\,d\,x\right )\,\left (n^6\,1{}\mathrm {i}+n^5\,22{}\mathrm {i}+n^4\,190{}\mathrm {i}+n^3\,820{}\mathrm {i}+n^2\,1849{}\mathrm {i}+n\,2038{}\mathrm {i}+840{}\mathrm {i}\right )}{16\,d\,\left (n^7\,1{}\mathrm {i}+n^6\,28{}\mathrm {i}+n^5\,322{}\mathrm {i}+n^4\,1960{}\mathrm {i}+n^3\,6769{}\mathrm {i}+n^2\,13132{}\mathrm {i}+n\,13068{}\mathrm {i}+5040{}\mathrm {i}\right )}-\frac {a^2\,{\sin \left (c+d\,x\right )}^n\,\cos \left (4\,c+4\,d\,x\right )\,\left (n^6\,1{}\mathrm {i}+n^5\,30{}\mathrm {i}+n^4\,334{}\mathrm {i}+n^3\,1764{}\mathrm {i}+n^2\,4633{}\mathrm {i}+n\,5694{}\mathrm {i}+2520{}\mathrm {i}\right )}{8\,d\,\left (n^7\,1{}\mathrm {i}+n^6\,28{}\mathrm {i}+n^5\,322{}\mathrm {i}+n^4\,1960{}\mathrm {i}+n^3\,6769{}\mathrm {i}+n^2\,13132{}\mathrm {i}+n\,13068{}\mathrm {i}+5040{}\mathrm {i}\right )}-\frac {a^2\,{\sin \left (c+d\,x\right )}^n\,\cos \left (2\,c+2\,d\,x\right )\,\left (-n^6\,1{}\mathrm {i}-n^5\,22{}\mathrm {i}-n^4\,62{}\mathrm {i}+n^3\,1228{}\mathrm {i}+n^2\,9159{}\mathrm {i}+n\,20490{}\mathrm {i}+12600{}\mathrm {i}\right )}{16\,d\,\left (n^7\,1{}\mathrm {i}+n^6\,28{}\mathrm {i}+n^5\,322{}\mathrm {i}+n^4\,1960{}\mathrm {i}+n^3\,6769{}\mathrm {i}+n^2\,13132{}\mathrm {i}+n\,13068{}\mathrm {i}+5040{}\mathrm {i}\right )}+\frac {a^2\,{\sin \left (c+d\,x\right )}^n\,\sin \left (5\,c+5\,d\,x\right )\,\left (3\,n^6+55\,n^5+397\,n^4+1445\,n^3+2792\,n^2+2700\,n+1008\right )\,1{}\mathrm {i}}{64\,d\,\left (n^7\,1{}\mathrm {i}+n^6\,28{}\mathrm {i}+n^5\,322{}\mathrm {i}+n^4\,1960{}\mathrm {i}+n^3\,6769{}\mathrm {i}+n^2\,13132{}\mathrm {i}+n\,13068{}\mathrm {i}+5040{}\mathrm {i}\right )}+\frac {a^2\,{\sin \left (c+d\,x\right )}^n\,\sin \left (3\,c+3\,d\,x\right )\,\left (15\,n^6+419\,n^5+4417\,n^4+22569\,n^3+58568\,n^2+71932\,n+31920\right )\,1{}\mathrm {i}}{64\,d\,\left (n^7\,1{}\mathrm {i}+n^6\,28{}\mathrm {i}+n^5\,322{}\mathrm {i}+n^4\,1960{}\mathrm {i}+n^3\,6769{}\mathrm {i}+n^2\,13132{}\mathrm {i}+n\,13068{}\mathrm {i}+5040{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________